export type Dictionary<T = any> = Record<string, T>

export type Data<T = any> = T | T[] 

export type SyncDataResult<T = any> = Data<T>

export type AsyncDataResult<T = any> = Promise<T | T[]>

export type PromiseArray<T = any> = Promise<T>[]

export type PromiseBoolean = AsyncDataResult<boolean>

export type AsyncVoid = AsyncDataResult<void>

export type OrderDirection = 'asc' | 'desc'


export interface SortCriteria {
  field: string
  direction?: OrderDirection
}

export interface PaginationQuery {
  size?: number
  no?: number
  where?: Dictionary
  orderBy?: SortCriteria[]
}

export interface Join { 
  table: string
  left: string
  right: string 
}